<!---
	Title:		EPAR1.1 
	Author:		Bruce Frick
	Purpose:	Search results page
--->

<cfset BASE = CreateObject("component", "cfc.base") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">
<cfoutput>
    
	<!---HTML header, css links, js links, and page title--->
    #BASE.htmlHeader(
    	"", <!---JS links--->
        "", <!---CSS links--->
        "Search Results", <!---Page Title--->
        "Home" <!---Active Nav Link--->
    )#
    <!---HTML header, css links, js links, and page title--->
    
    <cfif Session.strAuthType NEQ ''>
    	
        <h1 class="title">Search Results</h1>
		<div class="entry">
                                
			<cfset qryEmployeeSearchResults = CreateObject("component", "cfc.searchQueries").funcEmployeeSearchResults(URL.EmployeeID) />
            <cfset qryEmployeeSteps = CreateObject("component", "cfc.searchQueries").funcEmployeeSteps(URL.EmployeeID) />
            
            <!---Scott Code--->
            <cfif #qryEmployeeSearchResults.preferredname# neq "">
                <cfset EmployeeNameDisplay = #qryEmployeeSearchResults.First# & ' ' & 
                    '(#qryEmployeeSearchResults.preferredname#)' & ' ' & 
                    #qryEmployeeSearchResults.last#>
            <cfelse>
                <cfset EmployeeNameDisplay = #qryEmployeeSearchResults.First# & ' ' & 
                    #qryEmployeeSearchResults.last#>
            </cfif>
            
            <cfif #qryEmployeeSearchResults.address2# neq "">
                <cfset EmployeeAddress = #qryEmpDemo.address1# & ' ' & 
                    #qryEmployeeSearchResults.address2#>
            <cfelse>
                <cfset EmployeeAddress = #qryEmployeeSearchResults.address1#>
            </cfif>
            <!---Scott Code--->
            
            <cfloop query="qryEmployeeSearchResults">
                <!---Scott Code--->
                <div align="center">
                <strong>#EmployeeNameDisplay#</strong>
                </div>	
                <!---Scott Code--->
            </cfloop>
            <br />
            <table width="100%">
                <tr>
                    <td width="30%"><strong>STEPS</strong></td>
                    <td width="20%"><strong>DATE</strong></td>
                    <td width="25%"><strong>ACTION BY</strong></td>
                    <td width="25%"><strong>NOTES</strong></td>
                </tr>
                <cfloop query="qryEmployeeSteps">
                    <!---Scott Code--->
                    <cfset Emp = SCF_Employee_GetEmployee(ActionByID)>
                    <cfset FullName = Emp.Fullname>
                    <tr>
                        <td>#StepDesc#</td>
                        <td>#ActTimeStamp#</td>
                        <td nowrap="nowrap">#FullName#</td>
                        <td>#Notes#</td>
                    </tr>	
                    </cfloop>
                    <!---Scott Code--->
            </table>
            
            <br /><br /><br />
            
            <h1 class="title">Final Details</h1>
            <br />
            <div>
                <strong>Demographics</strong>
            </div>
            <br />
            
            <cfloop query="qryEmployeeSearchResults">
                <!---Scott Code--->
                <table width="100%">
                    <tr>
                        <td><strong>NAME</strong></td>
                        <td><strong>ADDRESS</strong></td>
                    </tr>
                    
                    <tr>
                        <td valign="top">#EmployeeNameDisplay#</td>
                        <td>
                        #EmployeeAddress#<br />
                        #city# #state#<br />
                        #zip#
                        </td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>PHONE</strong></td>
                        <td><strong>EMAIL</strong></td>
                    </tr>
                    <tr>
                        <td>
                            Home: <cfif #HomePhone# neq "">#BASE.DisplayPhone(HomePhone)#<cfelse>N/A</cfif><br />
                            Cell: <cfif #CellPhone# neq "">#BASE.DisplayPhone(CellPhone)#<cfelse>N/A</cfif><br />
                            Work: <cfif #WorkPhone# neq "">#BASE.DisplayPhone(WorkPhone)# &nbsp;Ext: #WorkPhoneExt#<cfelse>N/A</cfif>
                        </td>
                        <td valign="top"><cfif #email# neq "">#email#<cfelse>N/A</cfif></td>
                    </tr>	
                </table>
                    
                <br /><br />
                <div>
                    <strong>Job Info</strong>
                </div>
                <br />
                <table width="100%">
                    <tr>
                        <td><strong>CONTAINER</strong></td>
                        <td><strong>POSTING</strong></td>
                        <td><strong>POSITION</strong></td>
                        <td><strong>SUPERVISOR</strong></td>
                    </tr>
                    
                    <tr>
                        <td>#containerid#</td>
                        <td>#postingid#</td>
                        <td>#PositionID#</td>
                        <td>#SupervisorID#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>DEPT</strong></td>
                        <td><strong>BADGE</strong></td>
                        <td><strong>MIRROR</strong></td>
                        <td><strong>DESK PH</strong></td>
                    </tr>
                    <tr>
                        <td>#DeptID#</td>
                        <td>#BadgeAccessLevelID#</td>
                        <td>#MirrorAccountID#</td>
                        <td>#DeskPhone#</td>
                    </tr>	
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>TIME CARD</strong></td>
                        <td><strong>EST START</strong></td>
                        <td><strong>ACT START</strong></td>
                        <td><strong>EXEMPT</strong></td>
                    </tr>
                    <tr>
                        <td>#TimeCardApprs#</td>
                        <td>#dateformat(EstStartDate, 'mm/dd/yyyy')#</td>
                        <td>#dateformat(ActStartDate, 'mm/dd/yyyy')#</td>
                        <td>#Exempt#</td>
                    </tr>	
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>SEASONAL</strong></td>
                        <td><strong>PRIMARY</strong></td>
                        <td><strong>SAL/HR</strong></td>
                        <td><strong>WORK COMP</strong></td>
                    </tr>
                    <tr>
                        <td>#Seasonal#</td>
                        <td>#Primary#</td>
                        <td>#SalaryHourlyID#</td>
                        <td>#WorkersCompID#</td>
                    </tr>	
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>COMP TYPE</strong></td>
                        <td><strong>FREQUENCY</strong></td>
                        <td><strong>EMP CODE</strong></td>
                        <td><strong>FULL TIME</strong></td>
                    </tr>
                    <tr>
                        <td>#CompTypeID#</td>
                        <td>#FrequencyID#</td>
                        <td>#EmpCodeID#</td>
                        <td>#FullTime#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>HRS/WEEK</strong></td>
                        <td><strong>PAY RATE</strong></td>
                        <td><strong>ACCEPTED</strong></td>
                        <td><strong>DOB</strong></td>
                    </tr>
                    <tr>
                        <td>#HoursPerWeek#</td>
                        <td>#PayRate#</td>
                        <td>#OfferAccepted#</td>
                        <td>#dateformat(DOB, 'mm/dd/yyyy')#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>SSN</strong></td>
                        <td><strong>I9</strong></td>
                        <td><strong>MARITAL</strong></td>
                        <td><strong>GENDER</strong></td>
                    </tr>
                    <tr>
                        <td>#SSN#</td>
                        <td>#I9#</td>
                        <td>#MaritalStatusID#</td>
                        <td>#GenderID#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>ETHNICITY</strong></td>
                        <td><strong>NO SHOW</strong></td>
                        <td><strong>BADGE</strong></td>
                        <td><strong>COST CODE</strong></td>
                    </tr>
                    <tr>
                        <td>#EthnicID#</td>
                        <td>#OrientationNoShow#</td>
                        <td>#BadgeID#</td>
                        <td>#CostCode#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>BENEFITS</strong></td>
                        <td><strong>LEAVE</strong></td>
                        <td><strong>LUNCH</strong></td>
                        <td><strong>NON-SCF TYPE</strong></td>
                    </tr>
                    <tr>
                        <td>#Benifits#</td>
                        <td>#Leave#</td>
                        <td>#LunchID#</td>
                        <td>#NonSCFTypeID#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>NON-SCF NETWORK</strong></td>
                        <td><strong>NON-SCF BADGE</strong></td>
                        <td><strong>Company Name</strong></td>
                        <td><strong>EXP DATE</strong></td>
                    </tr>
                    <tr>
                        <td>#NonSCFNetworkAccount#</td>
                        <td>#NonSCFBadge#</td>
                        <td>#CompanyName#</td>
                        <td>#dateformat(ExpDate, 'mm/dd/yyyy')#</td>
                    </tr>
                    <tr><td>&nbsp;</td></tr>
                    <tr>
                        <td><strong>BADGE POS</strong></td>
                        <td><strong>SHIFT</strong></td>
                        <td><strong>DAILY</strong></td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>#BadgePos#</td>
                        <td>#ShiftID#</td>
                        <td>#Daily#</td>
                        <td>&nbsp;</td>
                    </tr>	
                </table>
                <!---Scott Code--->
            </cfloop>
        
        </div>
        
        
    <cfelse>
        <cfinclude template="Denied.cfm">
    </cfif>
    
    
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
    #BASE.htmlFooter()#
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>